<template>
    <div>
      <template v-for="(item, index) in options">
        <template v-if="values.includes(item.dictValue)">
          <span
            :key="item.dictValue"
            :index="index"
            :class="item.cssClass"
            >{{ item.dictLabel }}</span
          >
        </template>
      </template>
    </div>
  </template>
  
  <script>
  export default {
    name: "DictTag",
    props: {
      options: {
        type: Array,
      },
      value: String,
    },
    computed: {
      values() {
        if (this.value) {
          return Array.isArray(this.value) ? this.value : [this.value];
        } else {
          return [];
        }
      },
    },
  };
  </script>
  <style scoped>
  .el-tag + .el-tag {
    margin-left: 10px;
  }
  </style>